<!DOCTYPE html>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
<div id="sample" contentEditable></div>
<script>
test(function() {
    var sample = document.getElementById('sample');
    sample.appendChild(document.createTextNode('A text for creating line wrap '.repeat(50)));
    var selection = window.getSelection();
    selection.collapse(sample.firstChild, 0);
    // Make selection as caret with TextAffinity::Upstream
    selection.modify('move', 'forward', 'lineBoundary')
    // Call |VisibleSelection::setWithoutValidation()| via
    // |FrameSelection::nodeWillBeRemoved()|.
    sample.remove();
}, 'setWithoutValidation with upstream caret');
</script>
